-
-
Notifications
You must be signed in to change notification settings - Fork 397
Clean orphan files, temp fix #3902
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clean orphan files, temp fix #3902
Conversation
Clean orphan SQLite files on start-up that are being created by BrowserBookmark plugin. This is a temporary solution to prevent users' cache accumulating very large numbers of files / MB. Will be addressed properly with new version of plugin (complete rewrite for Flow Launcher V2).
🥷 Code experts: Jack251970, Yusyuriv Jack251970, onesounds have most 👩💻 activity in the files. See details
Activity based on git-commit:
Knowledge based on git-blame: ✨ Comment |
Be a legend 🏆 by adding a before and after screenshot of the changes you made, especially if they are around UI/UX. |
📝 WalkthroughWalkthroughAdded a startup cleanup in BrowserBookmark plugin Init to delete orphaned SQLite cache files (.db-shm/.db-wal/.sqlite-shm/.sqlite-wal) from the favicon cache directory, wrapped in try-catch with exception logging, then proceeds to LoadBookmarksIfEnabled. Changes
Sequence Diagram(s)sequenceDiagram
participant App
participant BrowserBookmarkPlugin
participant FileSystem
participant Logger
App->>BrowserBookmarkPlugin: Init()
BrowserBookmarkPlugin->>FileSystem: Enumerate favicon cache dir
alt Orphaned SQLite sidecar files found
BrowserBookmarkPlugin->>FileSystem: Delete *.db-shm/*.db-wal/*.sqlite-shm/*.sqlite-wal
end
opt On exception
BrowserBookmarkPlugin->>Logger: LogException("Failed to cleanup favicon cache", ex)
end
BrowserBookmarkPlugin-->>App: LoadBookmarksIfEnabled()
Estimated code review effort🎯 2 (Simple) | ⏱️ ~7 minutes Possibly related PRs
Suggested reviewers
Tip 🔌 Remote MCP (Model Context Protocol) integration is now available!Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats. ✨ Finishing Touches
🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Nitpick comments (2)
Plugins/Flow.Launcher.Plugin.BrowserBookmark/Main.cs (2)
42-53
: Optional: Only delete “older” files to reduce race risk with live SQLite sessions.To be extra conservative, you can skip very recent files (e.g., last write < 1–5 minutes) in case a DB connection is about to reuse them. This reduces the chance of colliding with a still-active or just-about-to-be-active SQLite session, even though this is a temp fix.
Example inside the foreach, before delete:
var age = DateTime.UtcNow - File.GetLastWriteTimeUtc(file); if (age < TimeSpan.FromMinutes(5)) { continue; }Would you like me to open a follow-up PR adding the “age threshold” guard and a small debug log for the number of files deleted?
48-48
: Ignore spelling warnings for shm/wal.The spell-checker warnings for “shm”/“wal” are expected technical terms (SQLite). Safe to ignore or add to the dictionary.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these settings in your CodeRabbit configuration.
📒 Files selected for processing (1)
Plugins/Flow.Launcher.Plugin.BrowserBookmark/Main.cs
(1 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (1)
Plugins/Flow.Launcher.Plugin.BrowserBookmark/Main.cs (2)
Plugins/Flow.Launcher.Plugin.WindowsSettings/Log.cs (1)
Exception
(15-18)Plugins/Flow.Launcher.Plugin.Explorer/ContextMenu.cs (1)
LogException
(489-492)
🪛 GitHub Check: Check Spelling
Plugins/Flow.Launcher.Plugin.BrowserBookmark/Main.cs
[warning] 48-48:
wal
is not a recognized word. (unrecognized-spelling)
[warning] 48-48:
shm
is not a recognized word. (unrecognized-spelling)
[warning] 48-48:
wal
is not a recognized word. (unrecognized-spelling)
[warning] 48-48:
shm
is not a recognized word. (unrecognized-spelling)
[warning] 48-48:
wal
is not a recognized word. (unrecognized-spelling)
[warning] 48-48:
shm
is not a recognized word. (unrecognized-spelling)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: gitStream.cm
- GitHub Check: build
🔇 Additional comments (1)
Plugins/Flow.Launcher.Plugin.BrowserBookmark/Main.cs (1)
40-58
: Pragmatic startup cleanup — aligns with PR objective.Good short-term safeguard to prevent cache bloat by purging orphan SQLite WAL/SHM files before bookmark loading. Exception is logged and Init proceeds, so startup resilience is preserved.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch!
Clean orphan SQLite files on start-up that are being created by BrowserBookmark plugin. This is a temporary solution to prevent users' cache accumulating very large numbers of files / MB.
Will be addressed properly with new version of plugin (complete rewrite for Flow Launcher V2).